#!/usr/bin/env bash

set -e

run=$(dirname "$0")/run
rm -rf target-ubuntu/AppDir
$run cargo build --locked --release

neovide=target-ubuntu/release/neovide
export LDAI_OUTPUT=neovide.AppImage
export LDAI_UPDATE_INFORMATION="gh-releases-zsync|neovide|neovide|latest|neovide.AppImage.zsync"
$run linuxdeploy \
    --executable=$neovide \
    --desktop-file=assets/neovide.desktop \
    --appdir=target-ubuntu/AppDir \
    --icon-file=assets/neovide.svg \
    --output=appimage
